package com.snaildesign.countdown.dao;

import java.util.Date;
import java.util.List;

import com.snaildesign.common.DAOException;
import com.snaildesign.common.dao.BaseDAO;
import com.snaildesign.datastruct.db.ScrollableSet;

public interface UtilityDAO extends BaseDAO {
	
	 /** �����ݿ�ϵͳʱ�� */
    public Date fetchDbSystemDate() throws DAOException;
    
    /** ͨ�õ�ִ�� SQL ��䣨Insert��Update��Delete������������������� */
    public int executeUpdate(String sqlIUD) throws DAOException;

    /** ͨ�õ�ִ��ͳ�Ƽ�¼�������ķ��� */
    public int executeCount(String sqlCount) throws DAOException;	
    
    /**
     * ͨ�ò�ѯ����������� SQL ��䣬���ؿ����л��ġ���̬�ġ���װ����ݼ���
     *
     * @param sql String
     * @throws DAOException
     * @return ScrollableSet
     */
    public ScrollableSet executeQuery(String sql) throws DAOException;

    /**
     * ͨ�ò�ѯ����������� SQL ��䣬���ؿ����л��ġ���̬�ġ���װ����ݼ���(���ҳ)
     * @param sql String
     * @param start int
     * @param end int
     * @throws DAOException
     * @return ScrollableSet
     */
    public ScrollableSet executeQuery(String sql, int start, int end) throws DAOException;
    
    /**
     * �����ϴ��ļ���һ�𷵻��ļ����ݣ��ļ��ڷ��������������ݴ档
     * tempPath��ʾ���ڷ������ϵ���ʱ�ļ�Ŀ¼����file_id��Ϊ��ʱ�ļ���
     *
     * @param fileId String
     * @param folderPath String
     * @throws DAOException
     * @return List
     */
    public List findUploadFile(String fileId, final String folderPath) throws DAOException;
    
    /**
     * ����ʱ�ļ��������ļ����ݵ� UPLOAD_FILE �?
     * tempPath��ʾ���ڷ������ϵ���ʱ�ļ���
     */
    public int insertUploadFile(final String fullName,
                                final String tempFilePath) throws DAOException;

    /**
     * ʹ���ֽ��������ļ��� UPLOAD_FILE��
     *
     * @param fullName String
     * @param content byte[]
     * @throws DAOException
     * @return int
     */
    public int insertUploadFile(final String fullName,
                                final byte[] content) throws DAOException;
    
    public int generateSeq(String seqName) throws DAOException;
    
    public String formatSequence(String seqName,String format,int length) throws DAOException;
    
}
